from j264.tools.boxes.Box import Box
from j264.tools.boxes.Patcher import Patcher


class Outlet(Box):

    ### INITIALIZER ###

    def __init__(self):
        Box.__init__(self, inlet_count=1, outlet_count=0)

    ### READ-ONLY PUBLIC PROPERTIES ###

    @property
    def parent_connections(self):
        index = self.patcher.outlets.index(self)
        [c for c in self.patcher.connections 
            if c.input is self.patcher and 
                c.inlet == index]
